package com.sdwz.borrow.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Data
@ApiModel(value="BookInfo对象", description="图书信息")
@TableName("book_info")
public class BookInfo {
    @ApiModelProperty("ID")
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty("类别id")
    @TableField(value = "cate_id")
    private String cateId;

    @ApiModelProperty("书名")
    @TableField(value = "book_name")
    private String bookName;

    @ApiModelProperty("作者")
    @TableField(value = "author")
    private String author;

    @ApiModelProperty("封面")
    @TableField(value = "cover_url")
    private String coverUrl;

    @ApiModelProperty("出版社")
    @TableField(value = "press")
    private String press;

    @ApiModelProperty("出版时间")
    @TableField(value = "publication_time")
    private LocalDate publicationTime;

    @ApiModelProperty("国际标准书号")
    @TableField(value = "ISBN")
    private String ISBN;

    @ApiModelProperty("简介")
    @TableField(value = "introduction")
    private String introduction;

    @ApiModelProperty("馆藏数量")
    @TableField(value = "collection_quantity")
    private Integer collectionQuantity;

    @ApiModelProperty("可借数量")
    @TableField(value = "loanable_quantity")
    private Integer loanableQuantity;

    @ApiModelProperty("单价")
    @TableField(value = "price")
    private BigDecimal price;

//    @Version
    @ApiModelProperty("版本控制")
    @TableField(value = "version")
    private Integer version;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty("逻辑删除 1-已删除，0-未删除")
    @TableLogic
    @TableField(value = "is_deleted",fill = FieldFill.INSERT)
    private Integer isDeleted;

    @ApiModelProperty("其他参数")
    @TableField(exist = false)
    private Map<String,Object> prama = new HashMap<>();
}
